import 'package:auto_route/auto_route.dart';
import 'package:provider_student/main.dart';
import 'package:provider_student/screens/login/login_input_phone.dart';
import 'package:provider_student/screens/login/login_screen.dart';
import 'package:provider_student/screens/main/discover_tab.dart';
import 'package:provider_student/screens/main/home_tab.dart';
import 'package:provider_student/screens/main/main_screen.dart';
import 'package:provider_student/screens/main/mine_tab.dart';
import 'package:provider_student/screens/main/recommend_users_screen.dart';

part 'app_router.gr.dart';

@AutoRouterConfig(replaceInRouteName: 'Screen|Tab,Route')
class AppRouter extends RootStackRouter {
  final AuthGuard authGuard;
  AppRouter({required this.authGuard});

  @override
  List<AutoRoute> get routes => [
    AutoRoute(page: SplashRoute.page, path: '/splash', initial: true),
    AutoRoute(
      page: MainRoute.page,
      // path: '/',
      guards: [authGuard], // 将 AuthGuard 应用于你的主内容
      children: [
        AutoRoute(page: HomeRoute.page, path: 'home'),
        AutoRoute(page: DiscoverRoute.page, path: 'discover'),
        AutoRoute(page: MineRoute.page, path: 'mine'),
      ],
    ),
    AutoRoute(page: RecommendUserListRoute.page, path: 'recommend_users'),
    // AutoRoute(page: DiscoverTab.page, path: '/discover'),
    AutoRoute(page: LoginRoute.page, path: '/login'),
    AutoRoute(page: PhoneLoginRoute.page, path: '/phone/login'),
  ];
}
